#pragma once
#include "Formula.h"
// 6 Faces of a cube
enum  CubeFace {faceU   = 0, faceD, faceF, faceR,  faceB,   faceL, faceNull  = 6};

// 6 Colors of a cube
enum  CubeColor{cYellow = 0, cWhite, cRed, cGreen, cOrange, cBlue, colorNull = 6};

// Index for a cube to description it's position
struct CubeIndex
{
    int x;
    int y;
    int z;
};

class CubeStatus
{
public:
    CubeStatus(void);
    virtual ~CubeStatus(void);
    void Rotate(Formula *pFormula);
    void Initial(int x, int y, int z, int level);
    void ResetFace();

    CubeFace*  GetState(){return m_faceColor;}
    CubeIndex* GetIndex(){return &m_index;}
protected:
    CubeFace  m_faceColor[6];
    CubeIndex m_index;

    // static data
    static CubeFace ColorDefault[];
    static CubeFace TurnAxis_X[];
    static CubeFace TurnAxis_Y[];
    static CubeFace TurnAxis_Z[];

    static CubeIndex s_TrunIndex[];
    static void s_TrunIndexAxis_X(CubeIndex &index);
    static void s_TrunIndexAxis_Y(CubeIndex &index);
    static void s_TrunIndexAxis_Z(CubeIndex &index);
};
